cmake_minimum_required(VERSION 3.5)
project(ChickenProject)

add_executable(chicken main.cpp)
target_include_directories(chicken PRIVATE include)

find_package(Doxygen)
if (DOXYGEN_FOUND)
    set(DOXYGEN_GENERATE_HTML YES)
    set(DOXYGEN_GENERATE_LATEX YES)
    set(DOXYGEN_EXTRACT_ALL YES)
    set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
    set(DOXYGEN_PROJECT_NAME "Chicken Documentation")
    set(DOXYGEN_PROJECT_BRIEF "Documentation for Chicken class")

    doxygen_add_docs(doc ${CMAKE_CURRENT_SOURCE_DIR})

    install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()

add_custom_target(chicken_doc ALL DEPENDS doc)

set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/doc")

install(TARGETS chicken DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include)

